package com.hx.alipay.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hx.alipay.pojo.User;
import com.hx.alipay.services.UserService;
import com.hx.alipay.util.Const;

@Controller
@RequestMapping("/user/")
public class UserController {

	@Autowired
	private UserService userBiz;

	@RequestMapping("login")
	public String userLogin(String username, String password, HttpSession session) {
		User user = userBiz.findUserLogin(username, password);
		if (null != user) {
			session.setAttribute(Const.CURRENT_USER, user);
		}
		// return "redirect:/order/detail?orderNo=2017062816010251581";
		return "redirect:/jsp/shopping_cart.jsp";
	}

}
